/**
 * 商品相关ajax函数
 */

 import request from '@/utils/request'

 // 获取分类列表
 export const getCateList = (params) => {
     return request({
         method: 'get',
         url: '/goods/catelist',
         params
     })
 }
 
 // 修改分类
 export const editCate = (data) => {
     return request({
         method: 'post',
         url: '/goods/editcate',
         data
     })
 }

//  添加分类
export const addcate = (data) => {
    return request({
        method: 'post',
        url: '/goods/addcate',
        data
    })
}

 // 删除分类
 export const delcate = (params) => {
    return request({
        method: 'get',
        url: '/goods/delcate',
        params
    })
}

 // 查询所有分类
 export const categories = () => {
    return request({
        method: 'get',
        url: '/goods/categories',
     
    })
}

//  添加商品
export const add = (data) => {
    return request({
        method: 'post',
        url: '/goods/add',
        data
    })
}

 // 查询所有分类
 export const gdlist = (params) => {
    return request({
        method: 'get',
        url: '/goods/list',
        params
    })
}

 // 删除商品
 export const delgd = (params) => {
    return request({
        method: 'get',
        url: '/goods/del',
        params
    })
}

//  修改商品
export const editgoods = (data) => {
    return request({
        method: 'post',
        url: '/goods/edit',
        data
    })
}